package com.medi.business.domain;

import com.medi.common.utils.SecurityUtils;
import com.medi.common.utils.uuid.IdUtils;
import lombok.Data;
import com.medi.common.annotation.Excel;
import com.medi.common.core.domain.BaseEntity;

import java.util.Date;

/**
 * 数据权限关系对象 data_relation
 * 
 * @author medi
 * @date 2024-09-13
 */
@Data
public class DataRelation extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private String id;

    /** 业务数据名称 */
    @Excel(name = "业务数据名称")
    private String dataName;

    /** 业务接口id */
    @Excel(name = "业务接口id")
    private String infId;

    /** 默认 角色id 可扩展 */
    @Excel(name = "默认 角色id 可扩展")
    private String objectId;

    /** 0: 角色  */
    @Excel(name = "0: 角色 ")
    private Long objectType;

    /** 条件公式 */
    @Excel(name = "条件公式")
    private String formula;


    public void creat() {
        this.setId(IdUtils.fastSimpleUUID());
        this.setCreateTime(new Date());
        this.setCreateBy(SecurityUtils.getNickname());

    }

    public void modif() {
        this.setUpdateTime(new Date());
        this.setUpdateBy(SecurityUtils.getNickname());
    }

}
